﻿using System;
using System.Windows.Forms;
using QuickTuner.Properties;

namespace QuickTuner
{
    static class Program
    {
        internal static Settings Config;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            // for resetting in dev environment only
            // Storage.LoadDefaultTemplates();

            // load configuration for quick access from other parts of app
            Config = Settings.Default;

            // winforms startup boiler plates
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // load the radio instance
            var radio = Storage.LoadRadio();
            radio.PlayEngine = new IEPlayEngine();

            // run the main QuickTuner form
            Application.Run(new radioForm(radio));

            // save and quit
            Storage.SaveRadio(radio);
            Config.Save();
        }
    }
}
